﻿@model PhoneBilling.Models.UnkownEditModel
@{
    ViewBag.Title = "原始话单查询";
    Layout = null;
}
<script type="text/javascript">       
$(document).ready(           
function () 
{  
    $(".myDatePickerClass1 ").datepicker({
        buttonImage: '@Url.Content("~/Content/image/calendar.gif")',               
        dateFormat: 'yy/mm/dd',                 
        showOn: 'button',               
        buttonImageOnly: true ,
        changeMonth:true,              
        changeYear:true,
    });   
}       
);
function success() 
{
     $("#@Model.ID").hide();
}
//function failure() 
//{
//     
//}
function begin() 
{
     $(".input-submit").attr("disabled",false);
}
function cul() 
{
    var price = $(".price").val();
    var second = $(".second").val();
    var totalSecond = $(".totalSecond").val();
    var times = Math.ceil( totalSecond/second);
    $(".times").val(times);
    $(".fee").val(times*price);
}
</script>
@using (Ajax.BeginForm(new AjaxOptions() { InsertionMode = InsertionMode.Replace, OnBegin = "begin()", OnSuccess="success()", UpdateTargetId = "unkownEdit", HttpMethod = "post" }))
{
    <div>
        <div class="input-text">
             @Html.LabelFor(m => m.原始话单)
             @Html.DisplayTextFor(m => m.原始话单)
             @Html.HiddenFor(m => m.原始话单)
             @Html.HiddenFor(m => m.ID)
        </div>
        <div class="input-text">
             @Html.LabelFor(m => m.主叫分机)
             @Html.DisplayTextFor(m => m.主叫分机)
             @Html.HiddenFor(m => m.主叫分机)
             @Html.LabelFor(m => m.拨出号码)
             @Html.DisplayTextFor(m => m.拨出号码)
             @Html.HiddenFor(m => m.拨出号码)
             @Html.LabelFor(m => m.挂机时间)
             @Html.DisplayTextFor(m => m.挂机时间)
             @Html.HiddenFor(m => m.挂机时间)
        </div>
        <div class="input-text">
             @Html.LabelFor(m => m.拨叫地区)
             @Html.TextBoxFor(m => m.拨叫地区)  
             @Html.ValidationMessageFor(m => m.拨叫地区, new { style = "color:Red" })
             @Html.LabelFor(m => m.话类)
             @Html.DropDownListFor(m => m.话类, new SelectList(Model.话类List, "ID", "Name"), new { style = "input-text" })
             @Html.ValidationMessageFor(m => m.话类, new { style = "color:Red" })
             @Html.LabelFor(m => m.时长)
             @Html.TextBoxFor(m => m.时长, new { @class = "totalSecond" })
             @Html.ValidationMessageFor(m => m.时长, new { style = "color:Red" })
        </div>
        <div class="input-text">
             @Html.LabelFor(m => m.话价)
             @Html.TextBoxFor(m => m.话价, new { @class = "price" })
             @Html.LabelFor(m => m.计次单位)
             @Html.TextBoxFor(m => m.计次单位, new { @class = "second" })
             @Html.LabelFor(m => m.通话计次)
             @Html.TextBoxFor(m => m.通话计次, new { @class = "times" })
             @Html.ValidationMessageFor(m => m.通话计次, new { style = "color:Red" })
             @Html.LabelFor(m => m.话费)
             @Html.TextBoxFor(m => m.话费, new { @class = "fee" })
             @Html.ValidationMessageFor(m => m.话费, new { style = "color:Red" })
             <input type="button" value="重算" class="input-submit" onclick="cul()" /> 
        </div>
        <p class="submit">
            <input type="submit" value="入话单" class="input-submit" />
        </p>
    </div>
}
